package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.FactorService;
import com.ruoyi.system.service.StationInfoService;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description:
 * @Author:let_free
 * @Date:2024/5/22/19:37
 **/
@RestController
@RequestMapping("/station")
@Slf4j
public class StationInfoController {
    @Autowired
    private StationInfoService stationInfoService;
    @Autowired
    private FactorService factorService;

    //    获取不携带气象要素的站点信息
    @GetMapping("/getStationInfo")
    public AjaxResult getStationInfo() {
        return AjaxResult.success(stationInfoService.getAllStationInfo());
    }

    //    获取最新的携带气象要素的站点信息
    @GetMapping("/getLatestStationInfo")
    public AjaxResult getLatestStationInfo() {
        log.info("定时拉取气象站点信息");
        return AjaxResult.success(stationInfoService.getAllStationInfoWithFactor());
    }
}
